package com.battery.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.battery.common.annotation.Excel;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;


/**
 * 用户对象 ws_app_user
 *
 * @author battery
 * @date 2021-01-20
 */
@Table(name = "ws_app_user")
public class AppUser {

    private static final long serialVersionUID = 1L;

    /**
     * 租借用户主键ID
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    @Excel(name = "参数主键", cellType = Excel.ColumnType.NUMERIC)
    private String id;

    /**
     * 昵称
     */
    @Excel(name = "昵称")
    private String nickName;

    /**
     * 用户授权编码
     */
    private String appUserCode;

    /**
     * 头像URL
     */
    @Excel(name = "头像URL")
    private String avatar;

    /**
     * 授权手机号
     */
    @Excel(name = "授权手机号")
    private String mobile;

    /**
     * 用户类型
     */
    @Excel(name = "用户类型")
    private Integer userType;

    /**
     * 所在省
     */
    @Excel(name = "所在省")
    private String province;

    /**
     * 所在市
     */
    @Excel(name = "所在市")
    private String city;

    /**
     * 性别
     */
    @Excel(name = "性别")
    private Integer sex;

    /**
     * 是否冻结
     */
    @Excel(name = "是否冻结")
    private Integer isFrozen;

    /**
     * 冻结原因
     */
    @Excel(name = "冻结原因")
    private String reason;

    /**
     * 是否为VIP
     */
    @Excel(name = "是否为VIP")
    private Integer isFree;

    /**
     * 余额
     */
    @Excel(name = "余额")
    private BigDecimal balance;


    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;


    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;


    /**
     *
     */
    private String sessionKey;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setAppUserCode(String appUserCode) {
        this.appUserCode = appUserCode;
    }

    public String getAppUserCode() {
        return appUserCode;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getMobile() {
        return mobile;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getProvince() {
        return province;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCity() {
        return city;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getSex() {
        return sex;
    }

    public void setIsFrozen(Integer isFrozen) {
        this.isFrozen = isFrozen;
    }

    public Integer getIsFrozen() {
        return isFrozen;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getReason() {
        return reason;
    }

    public void setIsFree(Integer isFree) {
        this.isFree = isFree;
    }

    public Integer getIsFree() {
        return isFree;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getBalance() {
        return balance;
    }


    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public String getSessionKey() {
        return sessionKey;
    }

    public void setSessionKey(String sessionKey) {
        this.sessionKey = sessionKey;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nickName", getNickName())
                .append("appUserCode", getAppUserCode())
                .append("avatar", getAvatar())
                .append("mobile", getMobile())
                .append("userType", getUserType())
                .append("province", getProvince())
                .append("city", getCity())
                .append("sex", getSex())
                .append("isFrozen", getIsFrozen())
                .append("reason", getReason())
                .append("isFree", getIsFree())
                .append("balance", getBalance())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
